import { App } from 'vue';

export default {
    // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
    install(app: App) {
        app.config.globalProperties.goPage = function (name: string, query={}) { 
            // 设置跳转标识
            this.$router.isPush = true;
            this.$router.push({
                name,
                query
            })
        }
        app.config.globalProperties.goBack = function(){
            // 设置跳转标识
            this.$router.isPush = false;
            this.$router.back()
        }
        app.config.globalProperties.replace = function (name: string, query={}) { 
            // 设置跳转标识
            this.$router.isPush = true;
            this.$router.replace({
                name,
                query
            })
        }
    }
}